Defining Device Characteristics Specific to an Imaging System
Most of the unique qualities and characteristics of the printing device for which you are implementing a driver are described in the resources that you provide. The ImageWriter II printer driver includes three resources for the raster imaging system.
You need to include resource definitions for the PostScript imaging system if you are developing a driver for a PostScript printing device. You need to include resource definitions for the vector imaging system if you are developing a driver for a vector printing device. All of these resources are described in the chapter "Printing Resources" in this book.
You must include a raster preferences ('rdip') resource for a raster printer driver. This resource specifies imaging options for your driver, including color information. The raster preferences resource for the ImageWriter II printer driver, which is shown in Listing 3-27, includes color information for each color plane provided by the printing device.
Listing 3-27 The raster preferences resource for the ImageWriter II printer driver
resource gxRasterPrefsType (gxRasterPrefsID, sysHeap, purgeable) { gxDefaultRaster, /* default options are fine */ 0x00900000,0x00900000, /* 144X144 dpi device */ 16, /* min band size == 2 head heights */ 0, /* max band size (0 is full page) */ 0x00004000, /* RAM percentage (25%) */ 100*1024, /* RAM slop (100K) */ 4, /* 4-bit device */ { /* dithering offscreen */ 3, gxDontSetHalftone + gxDotTypeIsDitherLevel, 0x002D0000, /* angle unused for dithering */ 0x003C0000, /* freq unused for dithering */ 4, /* dithering with level of 4 */ gxLuminanceTint, /* tint space unused for dithering */ /* dot color & background unused */ gxRGBSpace, gxNoProfile, 0, 0, 0, 0, gxRGBSpace, gxNoProfile, 0xFFFF, 0xFFFF, 0xFFFF, 0, gxRGBSpace, /* halftone space */ gxIndexedSpace, /* indexed color space */ gxPrintingDriverBaseID, /* the color set to use */ 1 /* the color profile to use */ }; };The raster package ('rpck')
resource controls how bitmap data is packed into rasters for your driver. QuickDraw GX provides a default version of this resource, so providing your own version is optional. Listing 3-28 shows the raster package resource for the ImageWriter II driver.Listing 3-28 The raster package resource for the ImageWriter II printer driver
resource gxRasterPackType (gxRasterPackID, sysHeap, purgeable) { /* The packing buffer size. For the ImageWriter II, this is the # of bytes in the largest single packaged line. */ 2500, 4, /* this is CMYK (so colorsPasses == 4) */ 16, /* print head is 16 pixels high */ 2, /* it takes 2 passes to achieve the 16 pixels */ 1, /* there is a 1 pixel difference between these two passes */ gxInterlaceColor,/* avoid ribbon contamination */ };The final raster resource provided by the ImageWriter II driver is the raster package controls ('ropt'
) resource, which you use to define how some forms of line feeding are performed on your printing device. Listing 3-29 shows the ImageWriter II printer driver version of this resource.Listing 3-29 The raster package controls resource for the ImageWriter II printer driver
resource gxRasterPackOptionsType (gxRasterPackOptionsID, sysHeap, purgeable) { gxPrintingBaseID, gxPrintingBaseID + 10, /* forward line-feed characteristics */ 98, /* max line-feed amount is 98 */ gxRasterNumToASCII, /* express line-feed as ASCII */ 2, /* minimum width is 2 */ "0", /* and pad with zeros */ "\0X1BT", /* <esc>T == set line-feed size */ "\0X1Bf\0X0A", /* <esc>f<lf> == direction forward, do line feed */ /* reverse line-feed characteristics */ 98, /* max line-feed amount is 98 */ gxRasterNumToASCII, /* express line-feed as ASCII */ 2, /* minimum width is 2 */ "0", /* and pad with zeros */ "\0X1BT", /* <esc>T == set line-feed size */ "\0X1Br\0X0A", /* <esc>r<lf> == direction reverse, do line feed */ };
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help